<aside id="sidebar" class="four columns">
                    	<div class="padsidebar">
                        <ul>
                            <li class="widget-container">
                                <h2 class="widget-title">Search</h2>
                                <form action="lists/search" id="searchform" method="get">
                                    <div class="bgsearch">
	                                    <input type="text" id="s" name="keywords">
	                                    <input type="submit" value='' class="searchbutton">
                                    </div>
                                </form>
                            </li>
                            <li class="widget-container">
                                <h2 class="widget-title">分类列表</h2>
                                <ul>
                                					<?php 
					$model = new \Common\Model\Category();
					$articleModel = new \Common\Model\Article();
					$data = $model->get();
					foreach($data as $field):
					//列表页地址
					$field['url'] =__ROOT__ .  "/l_c_". $field['cid'] . ".html";
					$field['total'] = $articleModel->where("category_cid={$field['cid']} and is_recycle=0")->count();
				?>
					
                                    <li><a href="<?php echo $field['url']?>"><?php echo $field['cname']?></a></li>
                                     
				<?php endforeach;?>
                                </ul>
                            </li>
                            <li class="widget-container">
                                <h2 class="widget-title">博文排行榜</h2>
                                <ul class="rp-widget">
                                					<?php 
					$model = new \Common\Model\Article();
					$data = $model->field('aid,title,sendtime,digest,thumb,imgs')->where("is_recycle=0")->orderBy('click','DESC')->limit(5)->get();
					foreach($data as $field):
					//列表页地址
					$field['url'] = U('lists/index',array('aid'=>$field['aid']));
				?>
					
                                    <li>
                                        <div class="postimg"><img src="<?php echo __ROOT__?>/<?php echo $field['thumb']?>"  /></div>
                                        <h3><a href="l_ct_<?php echo $field['aid']?>.html"><?php echo $field['title']?></a></h3>
                                        <span class="smalldate"><?php echo date('Y-m-d',$field['sendtime'])?></span>
                                        <span class="clear"></span>
                                    </li>
                                     
				<?php endforeach;?>
                                 </ul>
                            </li>
                           
                        </ul>
                        </div>
</aside>